package reflection;

import lombok.Data;

public class Test02 {

    public static void main(String[] args) throws ClassNotFoundException {
        Class c1 = Class.forName("reflection.User");
        Class c2 = Class.forName("reflection.User");
        Class c3 = Class.forName("reflection.User");
        Class c4 = Class.forName("reflection.User");

        System.out.println(c1.hashCode());
        System.out.println(c2.hashCode());
        System.out.println(c1);
    }
}

@Data
class User{
    private String name;
    private int id;
    private int age;
    public String wangming = "mingzai";  //网名，公有的，看看能否反射获得

    //有参构造器
    public User(){
        this.name = name;
        this.id = id;
    }
}
